
-- --------------------------------------------------
-- Entity Designer DDL Script for SQL Server 2005, 2008, and Azure
-- --------------------------------------------------
-- Date Created: 05/01/2013 15:37:14
-- Generated from EDMX file: D:\PROJET\HOTEL\dev\MalawHotel\Hotel.Models\DataModelHotel.edmx
-- --------------------------------------------------

SET QUOTED_IDENTIFIER OFF;
GO
USE [Hotel];
GO
IF SCHEMA_ID(N'dbo') IS NULL EXECUTE(N'CREATE SCHEMA [dbo]');
GO

-- --------------------------------------------------
-- Dropping existing FOREIGN KEY constraints
-- --------------------------------------------------

IF OBJECT_ID(N'[dbo].[FK_Caracteristique_Hotels_Hotels]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Caracteristique_Hotels] DROP CONSTRAINT [FK_Caracteristique_Hotels_Hotels];
GO
IF OBJECT_ID(N'[dbo].[FK_Caracteristique_Hotels_Ref_Caracteristique_Hotels]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Caracteristique_Hotels] DROP CONSTRAINT [FK_Caracteristique_Hotels_Ref_Caracteristique_Hotels];
GO
IF OBJECT_ID(N'[dbo].[FK_Chambre_Hotels_Hotels]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Chambre_Hotels] DROP CONSTRAINT [FK_Chambre_Hotels_Hotels];
GO
IF OBJECT_ID(N'[dbo].[FK_Chambre_Hotels_Ref_Statut_Chambres]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Chambre_Hotels] DROP CONSTRAINT [FK_Chambre_Hotels_Ref_Statut_Chambres];
GO
IF OBJECT_ID(N'[dbo].[FK_Chambre_Hotels_Ref_Type_Chambres]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Chambre_Hotels] DROP CONSTRAINT [FK_Chambre_Hotels_Ref_Type_Chambres];
GO
IF OBJECT_ID(N'[dbo].[FK_Chambre_Tarif_Saisons_Ref_Type_Chambres]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Chambre_Tarif_Saisons] DROP CONSTRAINT [FK_Chambre_Tarif_Saisons_Ref_Type_Chambres];
GO
IF OBJECT_ID(N'[dbo].[FK_Chambre_Tarif_Saisons_Tarif_Saisons]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Chambre_Tarif_Saisons] DROP CONSTRAINT [FK_Chambre_Tarif_Saisons_Tarif_Saisons];
GO
IF OBJECT_ID(N'[dbo].[FK_Equipement_Chambres_Chambre_Hotels]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Equipement_Chambres] DROP CONSTRAINT [FK_Equipement_Chambres_Chambre_Hotels];
GO
IF OBJECT_ID(N'[dbo].[FK_Equipement_Chambres_Liste_Equipements]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Equipement_Chambres] DROP CONSTRAINT [FK_Equipement_Chambres_Liste_Equipements];
GO
IF OBJECT_ID(N'[dbo].[FK_Facture_Clients]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Facture] DROP CONSTRAINT [FK_Facture_Clients];
GO
IF OBJECT_ID(N'[dbo].[FK_Facture_Reservations]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Facture] DROP CONSTRAINT [FK_Facture_Reservations];
GO
IF OBJECT_ID(N'[dbo].[FK_Guests_Ref_Pieces]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Guests] DROP CONSTRAINT [FK_Guests_Ref_Pieces];
GO
IF OBJECT_ID(N'[dbo].[FK_Hotels_Chaine_Hotels]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Hotels] DROP CONSTRAINT [FK_Hotels_Chaine_Hotels];
GO
IF OBJECT_ID(N'[dbo].[FK_Hotels_Ref_Classement_Etoiles]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Hotels] DROP CONSTRAINT [FK_Hotels_Ref_Classement_Etoiles];
GO
IF OBJECT_ID(N'[dbo].[FK_Hotels_Ref_Pays]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Hotels] DROP CONSTRAINT [FK_Hotels_Ref_Pays];
GO
IF OBJECT_ID(N'[dbo].[FK_Item_Facture_Facture]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Item_Facture] DROP CONSTRAINT [FK_Item_Facture_Facture];
GO
IF OBJECT_ID(N'[dbo].[FK_Item_Facture_Remise]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Item_Facture] DROP CONSTRAINT [FK_Item_Facture_Remise];
GO
IF OBJECT_ID(N'[dbo].[FK_Item_Facture_Type_Item_Facture]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Item_Facture] DROP CONSTRAINT [FK_Item_Facture_Type_Item_Facture];
GO
IF OBJECT_ID(N'[dbo].[FK_Paiement_Facture_Facture]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Paiement_Facture] DROP CONSTRAINT [FK_Paiement_Facture_Facture];
GO
IF OBJECT_ID(N'[dbo].[FK_Paiement_Facture_Methode_Paiement]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Paiement_Facture] DROP CONSTRAINT [FK_Paiement_Facture_Methode_Paiement];
GO
IF OBJECT_ID(N'[dbo].[FK_Ref_Pieces_Ref_Type_Pieces]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Ref_Pieces] DROP CONSTRAINT [FK_Ref_Pieces_Ref_Type_Pieces];
GO
IF OBJECT_ID(N'[dbo].[FK_Reservations_Chambres_Chambre_Hotels]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Reservations_Chambres] DROP CONSTRAINT [FK_Reservations_Chambres_Chambre_Hotels];
GO
IF OBJECT_ID(N'[dbo].[FK_Reservations_Chambres_Chambre_Tarif_Saisons]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Reservations_Chambres] DROP CONSTRAINT [FK_Reservations_Chambres_Chambre_Tarif_Saisons];
GO
IF OBJECT_ID(N'[dbo].[FK_Reservations_Chambres_Guests]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Reservations_Chambres] DROP CONSTRAINT [FK_Reservations_Chambres_Guests];
GO
IF OBJECT_ID(N'[dbo].[FK_Reservations_Chambres_Reservations]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Reservations_Chambres] DROP CONSTRAINT [FK_Reservations_Chambres_Reservations];
GO
IF OBJECT_ID(N'[dbo].[FK_Reservations_Clients]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Reservations] DROP CONSTRAINT [FK_Reservations_Clients];
GO
IF OBJECT_ID(N'[dbo].[FK_Reservations_Hotels]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Reservations] DROP CONSTRAINT [FK_Reservations_Hotels];
GO
IF OBJECT_ID(N'[dbo].[FK_Reservations_Niveau_Garantit]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Reservations] DROP CONSTRAINT [FK_Reservations_Niveau_Garantit];
GO
IF OBJECT_ID(N'[dbo].[FK_Reservations_Source_Reservation]', 'F') IS NOT NULL
    ALTER TABLE [dbo].[Reservations] DROP CONSTRAINT [FK_Reservations_Source_Reservation];
GO

-- --------------------------------------------------
-- Dropping existing tables
-- --------------------------------------------------

IF OBJECT_ID(N'[dbo].[Caracteristique_Hotels]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Caracteristique_Hotels];
GO
IF OBJECT_ID(N'[dbo].[Chaine_Hotels]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Chaine_Hotels];
GO
IF OBJECT_ID(N'[dbo].[Chambre_Hotels]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Chambre_Hotels];
GO
IF OBJECT_ID(N'[dbo].[Chambre_Tarif_Saisons]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Chambre_Tarif_Saisons];
GO
IF OBJECT_ID(N'[dbo].[Clients]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Clients];
GO
IF OBJECT_ID(N'[dbo].[Equipement_Chambres]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Equipement_Chambres];
GO
IF OBJECT_ID(N'[dbo].[Facture]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Facture];
GO
IF OBJECT_ID(N'[dbo].[Guests]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Guests];
GO
IF OBJECT_ID(N'[dbo].[Hotels]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Hotels];
GO
IF OBJECT_ID(N'[dbo].[Item_Facture]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Item_Facture];
GO
IF OBJECT_ID(N'[dbo].[Liste_Equipements]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Liste_Equipements];
GO
IF OBJECT_ID(N'[dbo].[Methode_Paiement]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Methode_Paiement];
GO
IF OBJECT_ID(N'[dbo].[Niveau_Garantit]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Niveau_Garantit];
GO
IF OBJECT_ID(N'[dbo].[Paiement_Facture]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Paiement_Facture];
GO
IF OBJECT_ID(N'[dbo].[Ref_Caracteristique_Hotels]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Ref_Caracteristique_Hotels];
GO
IF OBJECT_ID(N'[dbo].[Ref_Classement_Etoiles]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Ref_Classement_Etoiles];
GO
IF OBJECT_ID(N'[dbo].[Ref_Pays]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Ref_Pays];
GO
IF OBJECT_ID(N'[dbo].[Ref_Pieces]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Ref_Pieces];
GO
IF OBJECT_ID(N'[dbo].[Ref_Statut_Chambres]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Ref_Statut_Chambres];
GO
IF OBJECT_ID(N'[dbo].[Ref_Type_Chambres]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Ref_Type_Chambres];
GO
IF OBJECT_ID(N'[dbo].[Ref_Type_Pieces]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Ref_Type_Pieces];
GO
IF OBJECT_ID(N'[dbo].[Remise]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Remise];
GO
IF OBJECT_ID(N'[dbo].[Reservations]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Reservations];
GO
IF OBJECT_ID(N'[dbo].[Reservations_Chambres]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Reservations_Chambres];
GO
IF OBJECT_ID(N'[dbo].[Source_Reservation]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Source_Reservation];
GO
IF OBJECT_ID(N'[dbo].[Tarif_Saisons]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Tarif_Saisons];
GO
IF OBJECT_ID(N'[dbo].[Type_Item_Facture]', 'U') IS NOT NULL
    DROP TABLE [dbo].[Type_Item_Facture];
GO

-- --------------------------------------------------
-- Creating all tables
-- --------------------------------------------------

-- Creating table 'Chaine_Hotels'
CREATE TABLE [dbo].[Chaine_Hotels] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Nom_Chzine_Hotel] varchar(50)  NULL
);
GO

-- Creating table 'Chambre_Hotels'
CREATE TABLE [dbo].[Chambre_Hotels] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Hotel_ID] int  NULL,
    [Code_type_Chambre] int  NULL,
    [Numero_Chambre] varchar(10)  NULL,
    [Nombre_Etage_Chambre] int  NULL,
    [Statut_ID] int  NULL,
    [description_chambre] varchar(100)  NULL,
    [Notes_Additionnelles] varchar(500)  NULL
);
GO

-- Creating table 'Chambre_Tarif_Saisons'
CREATE TABLE [dbo].[Chambre_Tarif_Saisons] (
    [ID] int  NOT NULL,
    [Code_Saison] int  NULL,
    [Code_Type_Chambre] int  NULL,
    [Tarif] decimal(10,4)  NULL
);
GO

-- Creating table 'Clients'
CREATE TABLE [dbo].[Clients] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [titre] varchar(3)  NULL,
    [Prenom] varchar(100)  NULL,
    [Nom] varchar(20)  NULL,
    [DateNaiss] datetime  NULL,
    [Age] int  NULL,
    [Fumeur] bit  NULL,
    [pays] varchar(30)  NULL,
    [ville] varchar(20)  NULL,
    [adresse] varchar(100)  NULL,
    [email] varchar(50)  NULL,
    [telephone_mobile] varchar(30)  NULL,
    [telephone_fixe] varchar(30)  NULL,
    [telephone_Bureau] varchar(30)  NULL,
    [date_inscription] datetime  NULL
);
GO

-- Creating table 'Equipement_Chambres'
CREATE TABLE [dbo].[Equipement_Chambres] (
    [Equipement] int IDENTITY(1,1) NOT NULL,
    [Chambre] int  NOT NULL,
    [Details_Equipement] varchar(100)  NULL
);
GO

-- Creating table 'Facture'
CREATE TABLE [dbo].[Facture] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Code_Client] int  NULL,
    [Code_Reservation] int  NULL,
    [Commentaires] varchar(500)  NULL
);
GO

-- Creating table 'Guests'
CREATE TABLE [dbo].[Guests] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [titre] varchar(3)  NULL,
    [Prenom] varchar(100)  NULL,
    [Nom] varchar(20)  NULL,
    [DateNaiss] datetime  NULL,
    [Age] int  NULL,
    [Numero_Piece] int  NULL,
    [pays] varchar(30)  NULL,
    [ville] varchar(20)  NULL,
    [adresse] varchar(100)  NULL,
    [email] varchar(50)  NULL,
    [telephone_mobile] varchar(30)  NULL,
    [telephone_fixe] varchar(30)  NULL,
    [telephone_Bureau] varchar(30)  NULL
);
GO

-- Creating table 'Hotels'
CREATE TABLE [dbo].[Hotels] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [pays_ID] int  NULL,
    [Classement_ID] int  NULL,
    [Chaine_Hotel_ID] int  NULL,
    [Nom_Hotel] varchar(100)  NULL,
    [Adresse_Hotel] varchar(200)  NULL,
    [Code_Postal_Hotel] varchar(20)  NULL,
    [Ville_Hotel] varchar(50)  NULL,
    [Telephone] varchar(30)  NULL,
    [Fax] varchar(30)  NULL,
    [Url_Hotel] varchar(100)  NULL
);
GO

-- Creating table 'Item_Facture'
CREATE TABLE [dbo].[Item_Facture] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Numero_facture] int  NULL,
    [Numero_chambre] int  NULL,
    [Numero_Table] int  NULL,
    [Type_Item_Facture] int  NULL,
    [Description_Item_Facture] varchar(100)  NULL,
    [Montant_Item_Facture] decimal(10,4)  NULL,
    [Date_Facturation] datetime  NULL,
    [Remise_ID] int  NULL
);
GO

-- Creating table 'Liste_Equipements'
CREATE TABLE [dbo].[Liste_Equipements] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Description_Equippement] varchar(50)  NULL
);
GO

-- Creating table 'Methode_Paiement'
CREATE TABLE [dbo].[Methode_Paiement] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Description] varchar(30)  NULL
);
GO

-- Creating table 'Niveau_Garantit'
CREATE TABLE [dbo].[Niveau_Garantit] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Etat_Surete] varchar(20)  NULL,
    [Niveau] int  NULL
);
GO

-- Creating table 'Paiement_Facture'
CREATE TABLE [dbo].[Paiement_Facture] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Facture_ID] int  NULL,
    [Methode_paiement] int  NULL,
    [Numero_Carte_Credit] varchar(21)  NULL,
    [Mois_Expiration_Carte_Credit] char(2)  NULL,
    [Annee_Expiration_Carte_Credit] char(4)  NULL,
    [Proprietaire_Carte_Credit] varchar(100)  NULL,
    [Montant_Paiement] decimal(19,4)  NULL,
    [Date_Paiement] datetime  NULL
);
GO

-- Creating table 'Ref_Caracteristique_Hotels'
CREATE TABLE [dbo].[Ref_Caracteristique_Hotels] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Code_Caracteristique] varchar(20)  NULL,
    [Description_Caracterisque] varchar(100)  NULL
);
GO

-- Creating table 'Ref_Classement_Etoiles'
CREATE TABLE [dbo].[Ref_Classement_Etoiles] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [code_Classement_etoile] smallint  NULL,
    [image_classement_etoile] varbinary(max)  NULL
);
GO

-- Creating table 'Ref_Pays'
CREATE TABLE [dbo].[Ref_Pays] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Code_Money] char(3)  NULL,
    [Nom_Pays] varchar(50)  NULL,
    [Nom_Money] varchar(30)  NULL
);
GO

-- Creating table 'Ref_Pieces'
CREATE TABLE [dbo].[Ref_Pieces] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [ID_Type_Piece] int  NULL,
    [Numero_Piece] varchar(30)  NULL,
    [Date_Fabrication] datetime  NULL,
    [date_fin_validite] datetime  NULL
);
GO

-- Creating table 'Ref_Statut_Chambres'
CREATE TABLE [dbo].[Ref_Statut_Chambres] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Nom_Statut_Chambre] varchar(20)  NULL,
    [Description_Statut_Chambre] varchar(100)  NULL
);
GO

-- Creating table 'Ref_Type_Chambres'
CREATE TABLE [dbo].[Ref_Type_Chambres] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Nom_Type_Chambre] varchar(50)  NULL,
    [Tarif_Standard_Chambre] decimal(10,4)  NULL,
    [Description_Type_Chambre] varchar(200)  NULL,
    [Nombre_lit] smallint  NULL,
    [fumeur] bit  NULL
);
GO

-- Creating table 'Ref_Type_Pieces'
CREATE TABLE [dbo].[Ref_Type_Pieces] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Designation] varchar(30)  NULL
);
GO

-- Creating table 'Remise'
CREATE TABLE [dbo].[Remise] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Nom_Remise] varchar(30)  NULL,
    [Pourcentage_Remise] float  NULL,
    [Date_Expiration_Remise] datetime  NULL,
    [Montant_Remise] decimal(10,4)  NULL
);
GO

-- Creating table 'Reservations'
CREATE TABLE [dbo].[Reservations] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [date_Reservation] datetime  NULL,
    [Hotel_ID] int  NULL,
    [ID_Client] int  NULL,
    [Source] int  NULL,
    [Nombre_Guest] int  NULL,
    [Date_Debut_Reservation] datetime  NULL,
    [Date_Fin_reservation] datetime  NULL,
    [Echeance_Paiement_Totale] datetime  NULL,
    [Montant_Paiement_Total] decimal(19,4)  NULL,
    [Niveau_Garantit] int  NULL,
    [Date_Effective_Payement_totale] datetime  NULL,
    [Commentaire] varchar(max)  NULL
);
GO

-- Creating table 'Source_Reservation'
CREATE TABLE [dbo].[Source_Reservation] (
    [ID] int  NOT NULL,
    [Designation] varchar(50)  NULL
);
GO

-- Creating table 'Tarif_Saisons'
CREATE TABLE [dbo].[Tarif_Saisons] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Description_Tarif_Saison] varchar(100)  NULL,
    [Date_Debut_Saison] datetime  NULL,
    [Date_Fin_Saison] datetime  NULL
);
GO

-- Creating table 'Type_Item_Facture'
CREATE TABLE [dbo].[Type_Item_Facture] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Nom_Type_Item_Facture] varchar(30)  NULL,
    [Description_Type_Item_Facture] varchar(100)  NULL
);
GO

-- Creating table 'Reservations_Chambres'
CREATE TABLE [dbo].[Reservations_Chambres] (
    [ID] int IDENTITY(1,1) NOT NULL,
    [Code_Chambre] int  NULL,
    [Code_Guest] int  NULL,
    [Code_Reservation] int  NULL,
    [Tarif_Applique] int  NULL,
    [Date_Debut_Reservation_Effective] datetime  NULL,
    [Date_Fin_Reservation_Effective] datetime  NULL,
    [Commentaire] varchar(max)  NULL
);
GO

-- Creating table 'Caracteristique_Hotels'
CREATE TABLE [dbo].[Caracteristique_Hotels] (
    [Hotels_ID] int  NOT NULL,
    [Ref_Caracteristique_Hotels_ID] int  NOT NULL
);
GO

-- --------------------------------------------------
-- Creating all PRIMARY KEY constraints
-- --------------------------------------------------

-- Creating primary key on [ID] in table 'Chaine_Hotels'
ALTER TABLE [dbo].[Chaine_Hotels]
ADD CONSTRAINT [PK_Chaine_Hotels]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Chambre_Hotels'
ALTER TABLE [dbo].[Chambre_Hotels]
ADD CONSTRAINT [PK_Chambre_Hotels]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Chambre_Tarif_Saisons'
ALTER TABLE [dbo].[Chambre_Tarif_Saisons]
ADD CONSTRAINT [PK_Chambre_Tarif_Saisons]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Clients'
ALTER TABLE [dbo].[Clients]
ADD CONSTRAINT [PK_Clients]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [Equipement], [Chambre] in table 'Equipement_Chambres'
ALTER TABLE [dbo].[Equipement_Chambres]
ADD CONSTRAINT [PK_Equipement_Chambres]
    PRIMARY KEY CLUSTERED ([Equipement], [Chambre] ASC);
GO

-- Creating primary key on [ID] in table 'Facture'
ALTER TABLE [dbo].[Facture]
ADD CONSTRAINT [PK_Facture]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Guests'
ALTER TABLE [dbo].[Guests]
ADD CONSTRAINT [PK_Guests]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Hotels'
ALTER TABLE [dbo].[Hotels]
ADD CONSTRAINT [PK_Hotels]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Item_Facture'
ALTER TABLE [dbo].[Item_Facture]
ADD CONSTRAINT [PK_Item_Facture]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Liste_Equipements'
ALTER TABLE [dbo].[Liste_Equipements]
ADD CONSTRAINT [PK_Liste_Equipements]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Methode_Paiement'
ALTER TABLE [dbo].[Methode_Paiement]
ADD CONSTRAINT [PK_Methode_Paiement]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Niveau_Garantit'
ALTER TABLE [dbo].[Niveau_Garantit]
ADD CONSTRAINT [PK_Niveau_Garantit]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Paiement_Facture'
ALTER TABLE [dbo].[Paiement_Facture]
ADD CONSTRAINT [PK_Paiement_Facture]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Ref_Caracteristique_Hotels'
ALTER TABLE [dbo].[Ref_Caracteristique_Hotels]
ADD CONSTRAINT [PK_Ref_Caracteristique_Hotels]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Ref_Classement_Etoiles'
ALTER TABLE [dbo].[Ref_Classement_Etoiles]
ADD CONSTRAINT [PK_Ref_Classement_Etoiles]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Ref_Pays'
ALTER TABLE [dbo].[Ref_Pays]
ADD CONSTRAINT [PK_Ref_Pays]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Ref_Pieces'
ALTER TABLE [dbo].[Ref_Pieces]
ADD CONSTRAINT [PK_Ref_Pieces]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Ref_Statut_Chambres'
ALTER TABLE [dbo].[Ref_Statut_Chambres]
ADD CONSTRAINT [PK_Ref_Statut_Chambres]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Ref_Type_Chambres'
ALTER TABLE [dbo].[Ref_Type_Chambres]
ADD CONSTRAINT [PK_Ref_Type_Chambres]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Ref_Type_Pieces'
ALTER TABLE [dbo].[Ref_Type_Pieces]
ADD CONSTRAINT [PK_Ref_Type_Pieces]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Remise'
ALTER TABLE [dbo].[Remise]
ADD CONSTRAINT [PK_Remise]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Reservations'
ALTER TABLE [dbo].[Reservations]
ADD CONSTRAINT [PK_Reservations]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Source_Reservation'
ALTER TABLE [dbo].[Source_Reservation]
ADD CONSTRAINT [PK_Source_Reservation]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Tarif_Saisons'
ALTER TABLE [dbo].[Tarif_Saisons]
ADD CONSTRAINT [PK_Tarif_Saisons]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Type_Item_Facture'
ALTER TABLE [dbo].[Type_Item_Facture]
ADD CONSTRAINT [PK_Type_Item_Facture]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [ID] in table 'Reservations_Chambres'
ALTER TABLE [dbo].[Reservations_Chambres]
ADD CONSTRAINT [PK_Reservations_Chambres]
    PRIMARY KEY CLUSTERED ([ID] ASC);
GO

-- Creating primary key on [Hotels_ID], [Ref_Caracteristique_Hotels_ID] in table 'Caracteristique_Hotels'
ALTER TABLE [dbo].[Caracteristique_Hotels]
ADD CONSTRAINT [PK_Caracteristique_Hotels]
    PRIMARY KEY NONCLUSTERED ([Hotels_ID], [Ref_Caracteristique_Hotels_ID] ASC);
GO

-- --------------------------------------------------
-- Creating all FOREIGN KEY constraints
-- --------------------------------------------------

-- Creating foreign key on [Chaine_Hotel_ID] in table 'Hotels'
ALTER TABLE [dbo].[Hotels]
ADD CONSTRAINT [FK_Hotels_Chaine_Hotels]
    FOREIGN KEY ([Chaine_Hotel_ID])
    REFERENCES [dbo].[Chaine_Hotels]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Hotels_Chaine_Hotels'
CREATE INDEX [IX_FK_Hotels_Chaine_Hotels]
ON [dbo].[Hotels]
    ([Chaine_Hotel_ID]);
GO

-- Creating foreign key on [Hotel_ID] in table 'Chambre_Hotels'
ALTER TABLE [dbo].[Chambre_Hotels]
ADD CONSTRAINT [FK_Chambre_Hotels_Hotels]
    FOREIGN KEY ([Hotel_ID])
    REFERENCES [dbo].[Hotels]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Chambre_Hotels_Hotels'
CREATE INDEX [IX_FK_Chambre_Hotels_Hotels]
ON [dbo].[Chambre_Hotels]
    ([Hotel_ID]);
GO

-- Creating foreign key on [Statut_ID] in table 'Chambre_Hotels'
ALTER TABLE [dbo].[Chambre_Hotels]
ADD CONSTRAINT [FK_Chambre_Hotels_Ref_Statut_Chambres]
    FOREIGN KEY ([Statut_ID])
    REFERENCES [dbo].[Ref_Statut_Chambres]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Chambre_Hotels_Ref_Statut_Chambres'
CREATE INDEX [IX_FK_Chambre_Hotels_Ref_Statut_Chambres]
ON [dbo].[Chambre_Hotels]
    ([Statut_ID]);
GO

-- Creating foreign key on [Code_type_Chambre] in table 'Chambre_Hotels'
ALTER TABLE [dbo].[Chambre_Hotels]
ADD CONSTRAINT [FK_Chambre_Hotels_Ref_Type_Chambres]
    FOREIGN KEY ([Code_type_Chambre])
    REFERENCES [dbo].[Ref_Type_Chambres]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Chambre_Hotels_Ref_Type_Chambres'
CREATE INDEX [IX_FK_Chambre_Hotels_Ref_Type_Chambres]
ON [dbo].[Chambre_Hotels]
    ([Code_type_Chambre]);
GO

-- Creating foreign key on [Chambre] in table 'Equipement_Chambres'
ALTER TABLE [dbo].[Equipement_Chambres]
ADD CONSTRAINT [FK_Equipement_Chambres_Chambre_Hotels]
    FOREIGN KEY ([Chambre])
    REFERENCES [dbo].[Chambre_Hotels]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Equipement_Chambres_Chambre_Hotels'
CREATE INDEX [IX_FK_Equipement_Chambres_Chambre_Hotels]
ON [dbo].[Equipement_Chambres]
    ([Chambre]);
GO

-- Creating foreign key on [Code_Type_Chambre] in table 'Chambre_Tarif_Saisons'
ALTER TABLE [dbo].[Chambre_Tarif_Saisons]
ADD CONSTRAINT [FK_Chambre_Tarif_Saisons_Ref_Type_Chambres]
    FOREIGN KEY ([Code_Type_Chambre])
    REFERENCES [dbo].[Ref_Type_Chambres]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Chambre_Tarif_Saisons_Ref_Type_Chambres'
CREATE INDEX [IX_FK_Chambre_Tarif_Saisons_Ref_Type_Chambres]
ON [dbo].[Chambre_Tarif_Saisons]
    ([Code_Type_Chambre]);
GO

-- Creating foreign key on [Code_Saison] in table 'Chambre_Tarif_Saisons'
ALTER TABLE [dbo].[Chambre_Tarif_Saisons]
ADD CONSTRAINT [FK_Chambre_Tarif_Saisons_Tarif_Saisons]
    FOREIGN KEY ([Code_Saison])
    REFERENCES [dbo].[Tarif_Saisons]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Chambre_Tarif_Saisons_Tarif_Saisons'
CREATE INDEX [IX_FK_Chambre_Tarif_Saisons_Tarif_Saisons]
ON [dbo].[Chambre_Tarif_Saisons]
    ([Code_Saison]);
GO

-- Creating foreign key on [Code_Client] in table 'Facture'
ALTER TABLE [dbo].[Facture]
ADD CONSTRAINT [FK_Facture_Clients]
    FOREIGN KEY ([Code_Client])
    REFERENCES [dbo].[Clients]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Facture_Clients'
CREATE INDEX [IX_FK_Facture_Clients]
ON [dbo].[Facture]
    ([Code_Client]);
GO

-- Creating foreign key on [ID_Client] in table 'Reservations'
ALTER TABLE [dbo].[Reservations]
ADD CONSTRAINT [FK_Reservations_Clients]
    FOREIGN KEY ([ID_Client])
    REFERENCES [dbo].[Clients]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Reservations_Clients'
CREATE INDEX [IX_FK_Reservations_Clients]
ON [dbo].[Reservations]
    ([ID_Client]);
GO

-- Creating foreign key on [Equipement] in table 'Equipement_Chambres'
ALTER TABLE [dbo].[Equipement_Chambres]
ADD CONSTRAINT [FK_Equipement_Chambres_Liste_Equipements]
    FOREIGN KEY ([Equipement])
    REFERENCES [dbo].[Liste_Equipements]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Code_Reservation] in table 'Facture'
ALTER TABLE [dbo].[Facture]
ADD CONSTRAINT [FK_Facture_Reservations]
    FOREIGN KEY ([Code_Reservation])
    REFERENCES [dbo].[Reservations]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Facture_Reservations'
CREATE INDEX [IX_FK_Facture_Reservations]
ON [dbo].[Facture]
    ([Code_Reservation]);
GO

-- Creating foreign key on [Numero_facture] in table 'Item_Facture'
ALTER TABLE [dbo].[Item_Facture]
ADD CONSTRAINT [FK_Item_Facture_Facture]
    FOREIGN KEY ([Numero_facture])
    REFERENCES [dbo].[Facture]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Item_Facture_Facture'
CREATE INDEX [IX_FK_Item_Facture_Facture]
ON [dbo].[Item_Facture]
    ([Numero_facture]);
GO

-- Creating foreign key on [Facture_ID] in table 'Paiement_Facture'
ALTER TABLE [dbo].[Paiement_Facture]
ADD CONSTRAINT [FK_Paiement_Facture_Facture]
    FOREIGN KEY ([Facture_ID])
    REFERENCES [dbo].[Facture]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Paiement_Facture_Facture'
CREATE INDEX [IX_FK_Paiement_Facture_Facture]
ON [dbo].[Paiement_Facture]
    ([Facture_ID]);
GO

-- Creating foreign key on [Numero_Piece] in table 'Guests'
ALTER TABLE [dbo].[Guests]
ADD CONSTRAINT [FK_Guests_Ref_Pieces]
    FOREIGN KEY ([Numero_Piece])
    REFERENCES [dbo].[Ref_Pieces]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Guests_Ref_Pieces'
CREATE INDEX [IX_FK_Guests_Ref_Pieces]
ON [dbo].[Guests]
    ([Numero_Piece]);
GO

-- Creating foreign key on [Classement_ID] in table 'Hotels'
ALTER TABLE [dbo].[Hotels]
ADD CONSTRAINT [FK_Hotels_Ref_Classement_Etoiles]
    FOREIGN KEY ([Classement_ID])
    REFERENCES [dbo].[Ref_Classement_Etoiles]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Hotels_Ref_Classement_Etoiles'
CREATE INDEX [IX_FK_Hotels_Ref_Classement_Etoiles]
ON [dbo].[Hotels]
    ([Classement_ID]);
GO

-- Creating foreign key on [pays_ID] in table 'Hotels'
ALTER TABLE [dbo].[Hotels]
ADD CONSTRAINT [FK_Hotels_Ref_Pays]
    FOREIGN KEY ([pays_ID])
    REFERENCES [dbo].[Ref_Pays]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Hotels_Ref_Pays'
CREATE INDEX [IX_FK_Hotels_Ref_Pays]
ON [dbo].[Hotels]
    ([pays_ID]);
GO

-- Creating foreign key on [Hotel_ID] in table 'Reservations'
ALTER TABLE [dbo].[Reservations]
ADD CONSTRAINT [FK_Reservations_Hotels]
    FOREIGN KEY ([Hotel_ID])
    REFERENCES [dbo].[Hotels]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Reservations_Hotels'
CREATE INDEX [IX_FK_Reservations_Hotels]
ON [dbo].[Reservations]
    ([Hotel_ID]);
GO

-- Creating foreign key on [Remise_ID] in table 'Item_Facture'
ALTER TABLE [dbo].[Item_Facture]
ADD CONSTRAINT [FK_Item_Facture_Remise]
    FOREIGN KEY ([Remise_ID])
    REFERENCES [dbo].[Remise]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Item_Facture_Remise'
CREATE INDEX [IX_FK_Item_Facture_Remise]
ON [dbo].[Item_Facture]
    ([Remise_ID]);
GO

-- Creating foreign key on [Type_Item_Facture] in table 'Item_Facture'
ALTER TABLE [dbo].[Item_Facture]
ADD CONSTRAINT [FK_Item_Facture_Type_Item_Facture]
    FOREIGN KEY ([Type_Item_Facture])
    REFERENCES [dbo].[Type_Item_Facture]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Item_Facture_Type_Item_Facture'
CREATE INDEX [IX_FK_Item_Facture_Type_Item_Facture]
ON [dbo].[Item_Facture]
    ([Type_Item_Facture]);
GO

-- Creating foreign key on [Methode_paiement] in table 'Paiement_Facture'
ALTER TABLE [dbo].[Paiement_Facture]
ADD CONSTRAINT [FK_Paiement_Facture_Methode_Paiement]
    FOREIGN KEY ([Methode_paiement])
    REFERENCES [dbo].[Methode_Paiement]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Paiement_Facture_Methode_Paiement'
CREATE INDEX [IX_FK_Paiement_Facture_Methode_Paiement]
ON [dbo].[Paiement_Facture]
    ([Methode_paiement]);
GO

-- Creating foreign key on [Niveau_Garantit] in table 'Reservations'
ALTER TABLE [dbo].[Reservations]
ADD CONSTRAINT [FK_Reservations_Niveau_Garantit]
    FOREIGN KEY ([Niveau_Garantit])
    REFERENCES [dbo].[Niveau_Garantit]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Reservations_Niveau_Garantit'
CREATE INDEX [IX_FK_Reservations_Niveau_Garantit]
ON [dbo].[Reservations]
    ([Niveau_Garantit]);
GO

-- Creating foreign key on [ID_Type_Piece] in table 'Ref_Pieces'
ALTER TABLE [dbo].[Ref_Pieces]
ADD CONSTRAINT [FK_Ref_Pieces_Ref_Type_Pieces]
    FOREIGN KEY ([ID_Type_Piece])
    REFERENCES [dbo].[Ref_Type_Pieces]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Ref_Pieces_Ref_Type_Pieces'
CREATE INDEX [IX_FK_Ref_Pieces_Ref_Type_Pieces]
ON [dbo].[Ref_Pieces]
    ([ID_Type_Piece]);
GO

-- Creating foreign key on [Source] in table 'Reservations'
ALTER TABLE [dbo].[Reservations]
ADD CONSTRAINT [FK_Reservations_Source_Reservation]
    FOREIGN KEY ([Source])
    REFERENCES [dbo].[Source_Reservation]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Reservations_Source_Reservation'
CREATE INDEX [IX_FK_Reservations_Source_Reservation]
ON [dbo].[Reservations]
    ([Source]);
GO

-- Creating foreign key on [Hotels_ID] in table 'Caracteristique_Hotels'
ALTER TABLE [dbo].[Caracteristique_Hotels]
ADD CONSTRAINT [FK_Caracteristique_Hotels_Hotels]
    FOREIGN KEY ([Hotels_ID])
    REFERENCES [dbo].[Hotels]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;
GO

-- Creating foreign key on [Ref_Caracteristique_Hotels_ID] in table 'Caracteristique_Hotels'
ALTER TABLE [dbo].[Caracteristique_Hotels]
ADD CONSTRAINT [FK_Caracteristique_Hotels_Ref_Caracteristique_Hotels]
    FOREIGN KEY ([Ref_Caracteristique_Hotels_ID])
    REFERENCES [dbo].[Ref_Caracteristique_Hotels]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Caracteristique_Hotels_Ref_Caracteristique_Hotels'
CREATE INDEX [IX_FK_Caracteristique_Hotels_Ref_Caracteristique_Hotels]
ON [dbo].[Caracteristique_Hotels]
    ([Ref_Caracteristique_Hotels_ID]);
GO

-- Creating foreign key on [Code_Chambre] in table 'Reservations_Chambres'
ALTER TABLE [dbo].[Reservations_Chambres]
ADD CONSTRAINT [FK_Reservations_Chambres_Chambre_Hotels]
    FOREIGN KEY ([Code_Chambre])
    REFERENCES [dbo].[Chambre_Hotels]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Reservations_Chambres_Chambre_Hotels'
CREATE INDEX [IX_FK_Reservations_Chambres_Chambre_Hotels]
ON [dbo].[Reservations_Chambres]
    ([Code_Chambre]);
GO

-- Creating foreign key on [Tarif_Applique] in table 'Reservations_Chambres'
ALTER TABLE [dbo].[Reservations_Chambres]
ADD CONSTRAINT [FK_Reservations_Chambres_Chambre_Tarif_Saisons]
    FOREIGN KEY ([Tarif_Applique])
    REFERENCES [dbo].[Chambre_Tarif_Saisons]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Reservations_Chambres_Chambre_Tarif_Saisons'
CREATE INDEX [IX_FK_Reservations_Chambres_Chambre_Tarif_Saisons]
ON [dbo].[Reservations_Chambres]
    ([Tarif_Applique]);
GO

-- Creating foreign key on [Code_Guest] in table 'Reservations_Chambres'
ALTER TABLE [dbo].[Reservations_Chambres]
ADD CONSTRAINT [FK_Reservations_Chambres_Guests]
    FOREIGN KEY ([Code_Guest])
    REFERENCES [dbo].[Guests]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Reservations_Chambres_Guests'
CREATE INDEX [IX_FK_Reservations_Chambres_Guests]
ON [dbo].[Reservations_Chambres]
    ([Code_Guest]);
GO

-- Creating foreign key on [Code_Reservation] in table 'Reservations_Chambres'
ALTER TABLE [dbo].[Reservations_Chambres]
ADD CONSTRAINT [FK_Reservations_Chambres_Reservations]
    FOREIGN KEY ([Code_Reservation])
    REFERENCES [dbo].[Reservations]
        ([ID])
    ON DELETE NO ACTION ON UPDATE NO ACTION;

-- Creating non-clustered index for FOREIGN KEY 'FK_Reservations_Chambres_Reservations'
CREATE INDEX [IX_FK_Reservations_Chambres_Reservations]
ON [dbo].[Reservations_Chambres]
    ([Code_Reservation]);
GO

-- --------------------------------------------------
-- Script has ended
-- --------------------------------------------------